package com.bigknow.appstore.web.base.controller;

import com.bigknow.appstore.web.base.entity.FusionConfig;
import com.bigknow.appstore.web.base.service.ISystemConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by 李科风 on 2016-09-14.
 */
@Controller
@RequestMapping("/system/config")
public class SystemConfigController {

    @Autowired
    private ISystemConfigService sysCfgService;

    @RequestMapping
    public String index() {
        return "/base/config/config";
    }

    @RequestMapping("/getFusionConfig")
    @ResponseBody
    public FusionConfig getFusionConfig() {
        return sysCfgService.getFusionConfig();
    }

    @RequestMapping("/saveFusionConfig")
    @ResponseBody
    public String saveFusionConfig(FusionConfig config) {
        sysCfgService.saveFusionConfig(config);
        return "";
    }
}
